import 'package:base/base/theme.dart';
import 'package:base/base_lib.dart';
import 'package:favorites/res/images.dart';
import 'package:favorites/res/lang.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class FavoritesPage extends StatelessWidget {
  const FavoritesPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: ToolBar.noBack(FavoritesStrRes.favorites),
      body: Center(
        child: EmptyWidget(
          state: LoadState.State_Empty,
          successWidget: Text(FavoritesStrRes.favorites),
          emptyWidget: _emptyView,
        ),
      ),
    );
  }

  ///数据为空的视图
  Widget get _emptyView {
    return SizedBox(
      width: double.infinity,
      height: double.infinity,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          SizedBox(
            height: 100.h,
          ),
          FavoritesImage.ill_empty_state_favorite.assetImage(),
          Padding(
            padding: const EdgeInsets.only(top: 10),
            child: Text(
              FavoritesStrRes.noFavoritesYet,
              style: KTheme.emptyViewTextStyle,
            ),
          )
        ],
      ),
    );
  }
}
